FROM maven:3.9.4-sapmachine-17 AS builder

#COPY settings.xml /usr/share/maven/conf/settings.xml
COPY . /usr/src/mymaven

WORKDIR /usr/src/mymaven

RUN mvn clean package -P docker

FROM openjdk:17-ea-slim-buster

WORKDIR /app

COPY --from=builder /usr/src/mymaven/target/ai-agent-1.0.0-SNAPSHOT.jar ai-agent-1.0.0-SNAPSHOT.jar

EXPOSE 8601

CMD ["java", "-jar", "ai-agent-1.0.0-SNAPSHOT.jar"]
